Skip to content

perf(ui): Speed up large compact selects - #119596

Closed
scttcper wants to merge 4 commits into
masterfrom
scttcper/compact-select-performance
Closed

perf(ui): Speed up large compact selects#119596
scttcper wants to merge 4 commits into
masterfrom
scttcper/compact-select-performance

Conversation

@scttcper

@scttcper scttcper commented Jul 14, 2026

Copy link
Copy Markdown
Member

Large CompactSelects do unnecessary work to derive the trigger label and empty search state. This switches selected option lookups to a Set, exits once the selected values are found, and skips the empty filtering pass.

Virtualized rows now skip rerendering retained options on every range update. Grid rows also forward the TanStack measurement props and keep a small overscan buffer so the project selector stays filled in during fast scrolling.

Project selector benchmark Before After
Warm open median 43.9 ms 38.6 ms
Worst scroll frame 25.1 ms 9.5 ms
Estimated dropped frames 4 0

The scroll benchmark ran at 120 Hz over the same 3272 px distance. Stacks on #119595.

scttcper and others added 3 commits July 13, 2026 20:18
TanStack Virtual now reads offset dimensions for the scroll element, which left our JSDOM tests with an empty virtual range. Update the shared fixture and affected tests to mock the dimensions the library actually uses.

Memoize the existing item key callbacks so the new virtual core can keep its measurement cache across renders.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Avoid repeated selected-option lookups and skip empty search filtering work. Memoize virtualized rows and wire grid measurement refs so fast scrolling does less React work.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 14, 2026
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Story previews

Preview the stories changed in this PR on the Vercel deployment:

Preview deployment: https://sentry-ljtkd8qor.sentry.dev

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 93.95% 93.95% ±0%
Typed 135,012 135,020 🟢 +8
Untyped 8,693 8,694 🔴 +1
🔍 1 new type safety issue introduced

Type assertions (as) (1 new)

File Line Detail
static/app/components/core/compactSelect/gridList/option.tsx 155 as typeof GridListOptionComponentmemo( GridListOptionComponent ) as typeof GridListOptionComponent

This is informational only and does not block the PR.

Base automatically changed from scttcper/tanstack-virtual-upgrade to master July 14, 2026 16:44
Keep the trace logs URL filter coverage alongside the PR's row action test.

Co-Authored-By: Codex <noreply@openai.com>
if (selectedValues.has(option.value)) {
options.push(option);
if (options.length === selectedValues.size) {
break findSelectedOptions;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the identifier too extra

@getsantry

getsantry Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added the Stale label Aug 5, 2026
@getsantry getsantry Bot closed this Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant